package com.alks.function.mapper.oa;

import com.alks.entity.data.entity.oa.OaStyle;
import com.alks.function.data.request.oa.OaStyleReq;
import com.baomidou.mybatisplus.annotation.SqlParser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OaStyleMapper {
    List<OaStyle> getOaStyle(@Param("oaStyleReq") OaStyleReq oaStyleReq, @Param("names") List<String> names);

    @Select("select dept_level from SD_DEPARTMENT where dept_no = #{deptId}")
    Integer getDptLevel(String deptId);

    @Select("select parent_level from SD_DEPARTMENT where dept_no = #{deptId}")
    Integer getParentLevel(String deptId);

    @Select("select dept_no from SD_DEPARTMENT where parent_level = #{parentLevel}")
    List<String> getCurrentDepts(Integer parentLevel);

    List<String> getCurrentName(List<String> currentDepts);

    @SqlParser(filter = true)
    List<String> getChildDept(@Param("deptLevel") Integer deptLevel);

    List<String> getUpperName(Integer parentLevel);

    void insertIntoOaStyle(OaStyle oaStyle);

    void updateOaStyle(OaStyle oaStyle);

    void deleteOaStyle(OaStyle oaStyle);

    List<OaStyle> getOaStyleByIds(List<String> ids);
}
